<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>白鲸加速器刷时长</title>
    <script>
        async function invite() {
            const inviteCode = document.getElementById('inviteCode').value;
            const times = parseInt(document.getElementById('times').value, 10);
            const results = [];

            for (let i = 0; i < times; i++) {
                try {
                    const response = await fetch('YOUR_BACKEND_ENDPOINT', {
                        method: 'POST',
                        headers: {
                            'Content-Type': 'application/x-www-form-urlencoded',
                        },
                        body: `passwd=a5fc859e9c4a1a6c5e7edeab9cc0debc&email=${generateRandomEmail()}&invite_code=${inviteCode}`,
                    });
                    if (!response.ok) {
                        throw new Error(`HTTP error! status: ${response.status}`);
                    }
                    const responseBody = await response.text();
                    results.push(responseBody);
                    console.log(`邀请成功: ${inviteCode} 已邀请 ${i + 1} 个人`);
                } catch (error) {
                    console.error('邀请失败:', error);
                }
            }

            return results;
        }

        function generateRandomEmail() {
            const random = () => Math.floor(Math.random() * 10);
            const randomString = () => String.fromCharCode(...Array.from({ length: 4 }, () => random() + 65));
            return `${random()}${random()}${random()}${random()}${random()}@${randomString()}.${randomString().toLowerCase()}`;
        }

        function generateRandomId() {
            const characters = '123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
            let result = '';
            const charactersLength = characters.length;
            for (let i = 0; i < 32; i++) {
                result += characters.charAt(Math.floor(Math.random() * charactersLength));
            }
            return result;
        }
    </script>
</head>
<body>
<h1>白鲸加速器刷时长</h1>
<label for="inviteCode">邀请码:</label>
<input type="text" id="inviteCode" name="inviteCode" required>
<br><br>
<label for="times">次数:</label>
<input type="number" id="times" name="times" required>
<br><br>
<button onclick="invite()">开始邀请</button>
</body>
</html>